﻿/*
* Copyright (c) 2010-2012 Tesla Engine Group
* 
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* 
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* 
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/


using System;
using System.Globalization;
using System.Runtime.InteropServices;
using Tesla.Util;

namespace Tesla.Math {
    /// <summary>
    /// Defines a color using red, green, blue, and alpha values. The standard
    /// range for each component is [0f, 1f].
    /// </summary>
    [Serializable]
    [StructLayout(LayoutKind.Sequential)]
    public struct Color : IEquatable<Color> {

        /// <summary>
        /// Unsigned integer representing the color index.
        /// </summary>
        public uint PackedValue;

        /// <summary>
        /// Red component
        /// </summary>
        public byte R {
            get {
                return (byte) PackedValue;
            }
            set {
                PackedValue = (PackedValue & 0xFFFFFF00) | (uint) value;
            }
        }

        /// <summary>
        /// Green component
        /// </summary>
        public byte G {
            get {
                return (byte) (PackedValue >> 8);
            }
            set {
                PackedValue = (PackedValue & 0xFFFF00FF) | (uint) (value << 8);
            }
        }

        /// <summary>
        /// Blue component
        /// </summary>
        public byte B {
            get {
                return (byte) (PackedValue >> 16);
            }
            set {
                PackedValue = (PackedValue &  0xFF00FFFF) | (uint) (value << 16);
            }
        }

        /// <summary>
        /// Alpha component
        /// </summary>
        public byte A {
            get {
                return (byte) (PackedValue >> 24);
            }
            set {
                PackedValue = (PackedValue &  0xFFFFFF) | (uint) (value << 24);
            }
        }

        private static int _sizeInBytes = MemoryHelper.SizeOf<Color>();

        /// <summary>
        /// Gets the Color struct's size in bytes.
        /// </summary>
        public static int SizeInBytes {
            get {
                return _sizeInBytes;
            }
        }

        private static uint PackColor(float r, float g, float b, float a) {
            uint n = (uint) MathHelper.ClampAndRound(r * 255.0f, 0.0f, 255.0f);
            uint n1 = ((uint) MathHelper.ClampAndRound(g * 255.0f, 0.0f, 255.0f)) << 8;
            uint n2 = ((uint) MathHelper.ClampAndRound(b * 255.0f, 0.0f, 255.0f)) << 16;
            uint n3 = ((uint) MathHelper.ClampAndRound(a * 255.0f, 0.0f, 255.0f)) << 24;

            return n | n1 | n2 | n3;
        }

        /// <summary>
        /// Creates a new instance of Color from a packed int containing all four components.
        /// </summary>
        /// <param name="rgba">Packed int containing RGBA values</param>
        public Color(uint rgba) {
             PackedValue = rgba;
        }

        /// <summary>
        /// Creates a new instance of Color from RGBA byte values with range 0-255. If
        /// the component values are greater than 255 or less than 0, they will be clamped
        /// to the range 0-255.
        /// </summary>
        /// <param name="red">Red component</param>
        /// <param name="green">Green component</param>
        /// <param name="blue">Blue component</param>
        public Color(int red, int green, int blue) {
            if(((red | green | blue) & 0xFFFFFF00) != 0) {
                red = MathHelper.ClampToByte(red);
                green = MathHelper.ClampToByte(green);
                blue = MathHelper.ClampToByte(blue);
            }

            PackedValue = ((uint) red) | ((uint) (green << 8)) | ((uint) (blue << 16)) | 0xFF000000;
        }

        /// <summary>
        /// Creates a new instance of Color from RGBA byte values with range 0-255. If
        /// the component values are greater than 255 or less than 0, they will be clamped
        /// to the range 0-255.
        /// </summary>
        /// <param name="red">Red component</param>
        /// <param name="green">Green component</param>
        /// <param name="blue">Blue component</param>
        /// <param name="alpha">Alpha component</param>
        public Color(int red, int green, int blue, int alpha) {
            if(((red | green | blue) & 0xFFFFFF00) != 0) {
                red = MathHelper.ClampToByte(red);
                green = MathHelper.ClampToByte(green);
                blue = MathHelper.ClampToByte(blue);
                alpha = MathHelper.ClampToByte(alpha);
            }
            PackedValue = ((uint)red) | ((uint) (green << 8)) | ((uint) (blue << 16)) | ((uint) (alpha << 24));
        }

        /// <summary>
        /// Creates a new instance of Color. Alpha is set to 1.0f.
        /// </summary>
        /// <param name="red">Red component</param>
        /// <param name="green">Green component</param>
        /// <param name="blue">Blue component</param>
        public Color(float red, float green, float blue) {
            PackedValue = PackColor(red, green, blue, 1.0f);
        }

        /// <summary>
        /// Creates a new instance of Color.
        /// </summary>
        /// <param name="red">Red component</param>
        /// <param name="green">Green component</param>
        /// <param name="blue">Blue component</param>
        /// <param name="alpha">Alpha component</param>
        public Color(float red, float green, float blue, float alpha) {
            PackedValue = PackColor(red, green, blue, alpha);
        }

        /// <summary>
        /// Creates a new instance of Color. Alpha is set to 1.0f.
        /// </summary>
        /// <param name="rgb">Vector3 containing RGB components as XYZ</param>
        public Color(Vector3 rgb) {
            PackedValue = PackColor(rgb.X, rgb.Y, rgb.Z, 1.0f);
        }

        /// <summary>
        /// Creates a new instance of Color.
        /// </summary>
        /// <param name="rgb">Vector3 containing RGB components as XYZ</param>
        /// <param name="alpha">Alpha component</param>
        public Color(Vector3 rgb, float alpha){
            PackedValue = PackColor(rgb.X, rgb.Y, rgb.Z, alpha);
        }

        /// <summary>
        /// Creates a new instance of Color.
        /// </summary>
        /// <param name="rgba">Vector4 containing RGBA components as XYZW</param>
        public Color(Vector4 rgba) {
            PackedValue = PackColor(rgba.X, rgba.Y, rgba.Z, rgba.W);
        }

        /// <summary>
        /// Returns this Color as as 3-component float vector. RGB corresponds
        /// to XYZ.
        /// </summary>
        /// <returns>Vector3</returns>
        public Vector3 ToVector3() {
            Vector3 v;
            v.X = ((float) (PackedValue & 255)) / 255.0f;
            v.Y = ((float) ((PackedValue >> 8) & 255)) / 255.0f;
            v.Z = ((float) ((PackedValue >> 16) & 255)) / 255.0f;

            return v;
        }

        /// <summary>
        /// Returns this Color as 4-component float vector. RGBA corresponds
        /// to XYZW.
        /// </summary>
        /// <returns>Color</returns>
        public Vector4 ToVector4() {
            Vector4 v;
            v.X = ((float) (PackedValue & 255)) / 255.0f;
            v.Y = ((float) ((PackedValue >> 8) & 255)) / 255.0f;
            v.Z = ((float) ((PackedValue >> 16) & 255)) / 255.0f;
            v.W = ((float) ((PackedValue >> 24) & 255)) / 255.0f;

            return v;
        }

        /// <summary>
        /// Set the packed color index from four floats.
        /// </summary>
        /// <param name="r">Red component</param>
        /// <param name="g">Green component</param>
        /// <param name="b">Blue component</param>
        /// <param name="a">Alpha component</param>
        public void SetRGBA(float r, float g, float b, float a) {
            PackedValue = 0;
            PackedValue = PackColor(r, g, b, a);
        }

        /// <summary>
        /// Adjusts the contrast of the color. If the contrast is 0, the color is 50% gray
        /// and if its 1 the original color is returned.
        /// </summary>
        /// <param name="value">Source color</param>
        /// <param name="contrast">Contrast amount</param>
        /// <returns>Adjusted color</returns>
        public static Color AdjustContrast(Color value, float contrast) {
            uint cr = (uint) MathHelper.ClampToByte((int) (((value.R - 128) * contrast) + 128));
            uint cg = (uint) MathHelper.ClampToByte((int) (((value.G - 128) * contrast) + 128));
            uint cb = (uint) MathHelper.ClampToByte((int) (((value.B - 128) * contrast) + 128));
            uint ca = (uint) value.A;

            Color c;
            c.PackedValue = cr | (cg << 8) | (cb << 16) | (ca << 24);
            return c;
        }

        /// <summary>
        /// Adjusts the contrast of the color. If the contrast is 0, the color is 50% gray
        /// and if its 1 the original color is returned.
        /// </summary>
        /// <param name="value">Source color</param>
        /// <param name="contrast">Contrast amount</param>
        /// <param name="result">Existing color to hold result</param>
        public static void AdjustContrast(ref Color value, float contrast, out Color result) {
            uint cr = (uint) MathHelper.ClampToByte((int) (((value.R - 128) * contrast) + 128));
            uint cg = (uint) MathHelper.ClampToByte((int) (((value.G - 128) * contrast) + 128));
            uint cb = (uint) MathHelper.ClampToByte((int) (((value.B - 128) * contrast) + 128));
            uint ca = (uint) value.A;

            result.PackedValue = cr | (cg << 8) | (cb << 16) | (ca << 24);
        }

        /// <summary>
        /// Adjusts the saturation of the color. If the saturation is 0, then the grayscale
        /// color is chosen and if its 1, then the original color is returned.
        /// </summary>
        /// <param name="value">Source color</param>
        /// <param name="saturation">Saturation amount</param>
        /// <returns>Adjusted color</returns>
        public static Color AdjustSaturation(Color value, float saturation) {
            uint r = value.R;
            uint g = value.G;
            uint b = value.B;
            uint a = value.A;

            uint grey = (uint) MathHelper.Clamp((((float) r * .2125f) + ((float) g * .7154f) + ((float) b * .0721f)), 0.0f, 255.0f);

            uint cr = (uint) MathHelper.ClampToByte((int) (((r - grey) * saturation) + grey));
            uint cg = (uint) MathHelper.ClampToByte((int) (((g - grey) * saturation) + grey));
            uint cb = (uint) MathHelper.ClampToByte((int) (((b - grey) * saturation) + grey));

            Color c;
            c.PackedValue = cr | (cg << 8) | (cb << 16) | (a << 24);
            return c;
        }

        /// <summary>
        /// Adjusts the saturation of the color. If the saturation is 0, then the grayscale
        /// color is chosen and if its 1, then the original color is returned.
        /// </summary>
        /// <param name="value">Source color</param>
        /// <param name="saturation">Saturation amount</param>
        /// <param name="result">Existing color to hold result</param>
        public static void AdjustSaturation(ref Color value, float saturation, out Color result) {
            uint r = value.R;
            uint g = value.G;
            uint b = value.B;
            uint a = value.A;

            uint grey = (uint) MathHelper.Clamp((((float) r * .2125f) + ((float) g * .7154f) + ((float) b * .0721f)), 0.0f, 255.0f);

            uint cr = (uint) MathHelper.ClampToByte((int) (((r - grey) * saturation) + grey));
            uint cg = (uint) MathHelper.ClampToByte((int) (((g - grey) * saturation) + grey));
            uint cb = (uint) MathHelper.ClampToByte((int) (((b - grey) * saturation) + grey));

            result.PackedValue = cr | (cg << 8) | (cb << 16) | (a << 24);
        }

        /// <summary>
        /// Adds two colors together.
        /// </summary>
        /// <param name="a">First color</param>
        /// <param name="b">Second color</param>
        /// <returns>Resulting color</returns>
        public static Color Add(Color a, Color b) {
            uint cr = (uint) MathHelper.ClampToByte(a.R + b.R);
            uint cg = (uint) MathHelper.ClampToByte(a.G + b.G);
            uint cb = (uint) MathHelper.ClampToByte(a.B + b.B);
            uint ca = (uint) MathHelper.ClampToByte(a.A + b.A);

            Color c;
            c.PackedValue = cr | (cg << 8) | (cb << 16) | (ca << 24);
            return c;
        }

        /// <summary>
        /// Adds two colors together.
        /// </summary>
        /// <param name="a">First color</param>
        /// <param name="b">Second color</param>
        /// <param name="result">Existing color to hold result</param>
        public static void Add(ref Color a, ref Color b, out Color result) {
            uint cr = (uint) MathHelper.ClampToByte(a.R + b.R);
            uint cg = (uint) MathHelper.ClampToByte(a.G + b.G);
            uint cb = (uint) MathHelper.ClampToByte(a.B + b.B);
            uint ca = (uint) MathHelper.ClampToByte(a.A + b.A);

            result.PackedValue = cr | (cg << 8) | (cb << 16) | (ca << 24);
        }

        /// <summary>
        /// Subtracts a color from another.
        /// </summary>
        /// <param name="a">First color</param>
        /// <param name="b">Second color</param>
        /// <returns>Resulting color</returns>
        public static Color Subtract(Color a, Color b) {
            uint cr = (uint) MathHelper.ClampToByte(a.R - b.R);
            uint cg = (uint) MathHelper.ClampToByte(a.G - b.G);
            uint cb = (uint) MathHelper.ClampToByte(a.B - b.B);
            uint ca = (uint) MathHelper.ClampToByte(a.A - b.A);

            Color c;
            c.PackedValue = cr | (cg << 8) | (cb << 16) | (ca << 24);
            return c;
        }

        /// <summary>
        /// Subtracts a color from another.
        /// </summary>
        /// <param name="a">First color</param>
        /// <param name="b">Second color</param>
        /// <param name="result">Existing color to hold result</param>
        public static void Subtract(ref Color a, ref Color b, out Color result) {
            uint cr = (uint) MathHelper.ClampToByte(a.R - b.R);
            uint cg = (uint) MathHelper.ClampToByte(a.G - b.G);
            uint cb = (uint) MathHelper.ClampToByte(a.B - b.B);
            uint ca = (uint) MathHelper.ClampToByte(a.A - b.A);

            result.PackedValue = cr | (cg << 8) | (cb << 16) | (ca << 24);
        }

        /// <summary>
        /// Modulates two colors together.
        /// </summary>
        /// <param name="a">First color</param>
        /// <param name="b">Second color</param>
        /// <returns>Modulated color</returns>
        public static Color Modulate(Color a, Color b) {
            uint cr = (uint) MathHelper.ClampToByte(a.R * b.R);
            uint cg = (uint) MathHelper.ClampToByte(a.G * b.G);
            uint cb = (uint) MathHelper.ClampToByte(a.B * b.B);
            uint ca = (uint) MathHelper.ClampToByte(a.A * b.A);

            Color c;
            c.PackedValue = cr | (cg << 8) | (cb << 16) | (ca << 24);
            return c;
        }

        /// <summary>
        /// Modulates two colors together.
        /// </summary>
        /// <param name="a">First color</param>
        /// <param name="b">Second color</param>
        /// <param name="result">Existing color to hold result</param>
        public static void Modulate(ref Color a, ref Color b, out Color result) {
            uint cr = (uint) MathHelper.ClampToByte(a.R * b.R);
            uint cg = (uint) MathHelper.ClampToByte(a.G * b.G);
            uint cb = (uint) MathHelper.ClampToByte(a.B * b.B);
            uint ca = (uint) MathHelper.ClampToByte(a.A * b.A);

            result.PackedValue = cr | (cg << 8) | (cb << 16) | (ca << 24);
        }

        /// <summary>
        /// Scales a color by a scaling factor.
        /// </summary>
        /// <param name="value">Source color</param>
        /// <param name="scale">Amount to multiply</param>
        /// <returns>Scaled color</returns>
        public static Color Scale(Color value, float scale) {
            uint cr = (uint) MathHelper.ClampToByte((int) (value.R * scale));
            uint cg = (uint) MathHelper.ClampToByte((int) (value.G * scale));
            uint cb = (uint) MathHelper.ClampToByte((int) (value.B * scale));
            uint ca = (uint) MathHelper.ClampToByte((int) (value.A * scale));

            Color c;
            c.PackedValue = cr | (cg << 8) | (cb << 16) | (ca << 24);
            return c;
        }

        /// <summary>
        /// Scales a color by a scaling factor.
        /// </summary>
        /// <param name="value">Source color</param>
        /// <param name="scale">Amount to multiply</param>
        /// <param name="result">Scaled color</param>
        public static void Scale(ref Color value, float scale, out Color result) {
            uint cr = (uint) MathHelper.ClampToByte((int) (value.R * scale));
            uint cg = (uint) MathHelper.ClampToByte((int) (value.G * scale));
            uint cb = (uint) MathHelper.ClampToByte((int) (value.B * scale));
            uint ca = (uint) MathHelper.ClampToByte((int) (value.A * scale));

            result.PackedValue = cr | (cg << 8) | (cb << 16) | (ca << 24);
        }

        /// <summary>
        /// Negates this color by subtracting each of its components from 1.0f.
        /// </summary>
        public void Negate() {
            this.R = (byte) (255 - R);
            this.G = (byte) (255 - G);
            this.B = (byte) (255 - B);
            this.A = (byte) (255 - A);
        }

        /// <summary>
        /// Negates the specified color by subtracting each of its components from 1.0f.
        /// </summary>
        /// <param name="value">Source color</param>
        /// <returns>Negated color</returns>
        public static Color Negate(Color value) {
            uint cr = (uint) (255 - value.R);
            uint cg = (uint) (255 - value.G);
            uint cb = (uint) (255 - value.B);
            uint ca = (uint) (255 - value.A);

            Color c;
            c.PackedValue = cr | (cg << 8) | (cb << 16) | (ca << 24);
            return c;
        }

        /// <summary>
        /// Negates the specified color by subtracting each of its components from 1.0f.
        /// </summary>
        /// <param name="value">Source color</param>
        /// <param name="result">Existing color to hold result</param>
        public static void Negate(ref Color value, out Color result) {
            uint cr = (uint) (255 - value.R);
            uint cg = (uint) (255 - value.G);
            uint cb = (uint) (255 - value.B);
            uint ca = (uint) (255 - value.A);

            result.PackedValue = cr | (cg << 8) | (cb << 16) | (ca << 24);
        }

        /// <summary>
        /// Linearly interpolates between two colors.
        /// </summary>
        /// <param name="a">Starting color</param>
        /// <param name="b">Ending color</param>
        /// <param name="percent">Amount to interpolate by</param>
        /// <returns>Interpolated color</returns>
        public static Color Lerp(Color a, Color b, float percent) {
            uint cr = (uint) MathHelper.ClampToByte(a.R + (int) ((b.R - a.R) * percent));
            uint cg = (uint) MathHelper.ClampToByte(a.G + (int) ((b.G - a.G) * percent));
            uint cb = (uint) MathHelper.ClampToByte(a.B + (int) ((b.B - a.B) * percent));
            uint ca = (uint) MathHelper.ClampToByte(a.A + (int) ((b.A - a.A) * percent));

            Color c;
            c.PackedValue = cr | (cg << 8) | (cb << 16) | (ca << 24);
            return c;
        }

        /// <summary>
        /// Linearly interpolates between two colors.
        /// </summary>
        /// <param name="a">Starting color</param>
        /// <param name="b">Ending color</param>
        /// <param name="percent">Amount to interpolate by</param>
        /// <param name="result">Existing color to hold result</param>
        public static void Lerp(ref Color a, ref Color b, float percent, out Color result) {
            uint cr = (uint) MathHelper.ClampToByte(a.R + (int) ((b.R - a.R) * percent));
            uint cg = (uint) MathHelper.ClampToByte(a.G + (int) ((b.G - a.G) * percent));
            uint cb = (uint) MathHelper.ClampToByte(a.B + (int) ((b.B - a.B) * percent));
            uint ca = (uint) MathHelper.ClampToByte(a.A + (int) ((b.A - a.A) * percent));

            result.PackedValue = cr | (cg << 8) | (cb << 16) | (ca << 24);
        }

        /// <summary>
        /// Tests equality between this color and another color.
        /// </summary>
        /// <param name="value">Vector to test against</param>
        /// <returns>True if components are equal</returns>
        public bool Equals(Color value) {
            return PackedValue == value.PackedValue;
        }

        /// <summary>
        /// Tests equality between two colors.
        /// </summary>
        /// <param name="a">First color</param>
        /// <param name="b">Second color</param>
        /// <returns>True if components are equal</returns>
        public static bool operator==(Color a, Color b) {
            return a.PackedValue == b.PackedValue;
        }

        /// <summary>
        /// Tests inequality between two colors.
        /// </summary>
        /// <param name="a">First color</param>
        /// <param name="b">Second color</param>
        /// <returns>True if components are not equal</returns>
        public static bool operator!=(Color a, Color b) {
            return a.PackedValue != b.PackedValue;
        }

        /// <summary>
        /// Adds the two colors together.
        /// </summary>
        /// <param name="a">First color</param>
        /// <param name="b">Second color</param>
        /// <returns>Added color</returns>
        public static Color operator+(Color a, Color b) {
            uint cr = (uint) MathHelper.ClampToByte(a.R + b.R);
            uint cg = (uint) MathHelper.ClampToByte(a.G + b.G);
            uint cb = (uint) MathHelper.ClampToByte(a.B + b.B);
            uint ca = (uint) MathHelper.ClampToByte(a.A + b.A);

            Color c;
            c.PackedValue = cr | (cg << 8) | (cb << 16) | (ca << 24);
            return c;
        }

        /// <summary>
        /// Negates the color (subtracts index from 1.0f) of each color component.
        /// </summary>
        /// <param name="value">Source color</param>
        /// <returns>Negated color</returns>
        public static Color operator-(Color value) {
            uint cr = (uint) (255 - value.R);
            uint cg = (uint) (255 - value.G);
            uint cb = (uint) (255 - value.B);
            uint ca = (uint) (255 - value.A);

            Color c;
            c.PackedValue = cr | (cg << 8) | (cb << 16) | (ca << 24);
            return c;
        }

        /// <summary>
        /// Subtracts a color from another.
        /// </summary>
        /// <param name="a">First color</param>
        /// <param name="b">Second color</param>
        /// <returns>Resulting color</returns>
        public static Color operator-(Color a, Color b) {
            uint cr = (uint) MathHelper.ClampToByte(a.R - b.R);
            uint cg = (uint) MathHelper.ClampToByte(a.G - b.G);
            uint cb = (uint) MathHelper.ClampToByte(a.B - b.B);
            uint ca = (uint) MathHelper.ClampToByte(a.A - b.A);

            Color c;
            c.PackedValue = cr | (cg << 8) | (cb << 16) | (ca << 24);
            return c;
        }

        /// <summary>
        /// Modulates two colors together.
        /// </summary>
        /// <param name="a">First color</param>
        /// <param name="b">Second color</param>
        /// <returns>Modulated color</returns>
        public static Color operator*(Color a, Color b) {
            uint cr = (uint) MathHelper.ClampToByte(a.R * b.R);
            uint cg = (uint) MathHelper.ClampToByte(a.G * b.G);
            uint cb = (uint) MathHelper.ClampToByte(a.B * b.B);
            uint ca = (uint) MathHelper.ClampToByte(a.A * b.A);

            Color c;
            c.PackedValue = cr | (cg << 8) | (cb << 16) | (ca << 24);
            return c;
        }

        /// <summary>
        /// Scales a color by a scaling factor.
        /// </summary>
        /// <param name="value">Source color</param>
        /// <param name="scale">Amount to multiply</param>
        /// <returns>Scaled color</returns>
        public static Color operator*(Color value, float scale) {
            uint cr = (uint) MathHelper.ClampToByte((int) (value.R * scale));
            uint cg = (uint) MathHelper.ClampToByte((int) (value.G * scale));
            uint cb = (uint) MathHelper.ClampToByte((int) (value.B * scale));
            uint ca = (uint) MathHelper.ClampToByte((int) (value.A * scale));

            Color c;
            c.PackedValue = cr | (cg << 8) | (cb << 16) | (ca << 24);
            return c;
        }

        /// <summary>
        /// Scales a color by a scaling factor.
        /// </summary>
        /// <param name="scale">Amount to multiply</param>
        /// <param name="value">Source color</param>
        /// <returns>Scaled color</returns>
        public static Color operator*(float scale, Color value) {
            uint cr = (uint) MathHelper.ClampToByte((int) (value.R * scale));
            uint cg = (uint) MathHelper.ClampToByte((int) (value.G * scale));
            uint cb = (uint) MathHelper.ClampToByte((int) (value.B * scale));
            uint ca = (uint) MathHelper.ClampToByte((int) (value.A * scale));

            Color c;
            c.PackedValue = cr | (cg << 8) | (cb << 16) | (ca << 24);
            return c;
        }

        /// <summary>
        /// Tests equality between this color and the supplied object.
        /// </summary>
        /// <param name="obj">Object to compare</param>
        /// <returns>True if object is a color and components are equal</returns>
        public override bool Equals(object obj) {
            if(obj is Color) {
                return Equals((Color) obj);
            }
            return false;
        }

        /// <summary>
        /// Get the object's hash code.
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode() {
            return (this.R.GetHashCode() + this.G.GetHashCode() + this.B.GetHashCode() + this.A.GetHashCode());
        }

        /// <summary>
        /// Get a string representation for the object.
        /// </summary>
        /// <returns>String representation</returns>
        public override String ToString() {
            CultureInfo info = CultureInfo.CurrentCulture;
            return String.Format(info, "{{R:{0} G:{1} B:{2} A:{3}}}",
                new Object[] { this.R.ToString(info), this.G.ToString(info), this.B.ToString(info), this.A.ToString(info) });
        }

        /// <summary>
        /// Gets a color with the index R:240 G:248 B:255 A:255.
        /// </summary>
        public static Color AliceBlue {
            get {
                return new Color(4294965488);
            }
        }

        /// <summary>
        /// Gets a color with the index R:250 G:235 B:215 A:255.
        /// </summary>
        public static Color AntiqueWhite {
            get {
                return new Color(4292340730);
            }
        }
        
        /// <summary>
        /// Gets a color with the index R:0 G:255 B:255 A:255.
        /// </summary>
        public static Color Aqua {
            get {
                return new Color(4294967040);
            }
        }

        /// <summary>
        /// Gets a color with the index R:127 G:255 B:212 A:255.
        /// </summary>
        public static Color Aquamarine {
            get {
                return new Color(4292149119);
            }
        }
 
        /// <summary>
        /// Gets a color with the index R:240 G:255 B:255 A:255.
        /// </summary>
        public static Color Azure {
            get {
                return new Color(4294967280);
            }
        }
 
        /// <summary>
        /// Gets a color with the index R:245 G:245 B:220 A:255.
        /// </summary>
        public static Color Beige {
            get {
                return new Color(4292670965);
            }
        }
 
        /// <summary>
        /// Gets a color with the index R:255 G:228 B:196 A:255.
        /// </summary>
        public static Color Bisque {
            get {
                return new Color(4291093759);
            }
        }
 
        /// <summary>
        /// Gets a color with the index R:0 G:0 B:0 A:255.
        /// </summary>
        public static Color Black {
            get {
                return new Color(4278190080);
            }
        }
 
        /// <summary>
        /// Gets a color with the index R:255 G:235 B:205 A:255.
        /// </summary>
        public static Color BlanchedAlmond {
            get {
                return new Color(4291685375);
            }
        }

        /// <summary>
        /// Gets a color with the index R:0 G:0 B:255 A:255.
        /// </summary>
        public static Color Blue {
            get {
                return new Color(4294901760);
            }
        }

        /// <summary>
        /// Gets a color with the index R:138 G:43 B:226 A:255.
        /// </summary>
        public static Color BlueViolet {
            get {
                return new Color(4293012362);
            }
        }
 
        /// <summary>
        /// Gets a color with the index R:165 G:42 B:42 A:255.
        /// </summary>
        public static Color Brown {
            get {
                return new Color(4280953509);
            }
        }

        /// <summary>
        /// Gets a color with the index R:222 G:184 B:135 A:255.
        /// </summary>
        public static Color BurlyWood {
            get {
                return new Color(4287084766);
            }
        }
 
        /// <summary>
        /// Gets a color with the index R:95 G:158 B:160 A:255.
        /// </summary>
        public static Color CadetBlue {
            get {
                return new Color(4288716383);
            }
        }
 
        /// <summary>
        /// Gets a color with the index R:127 G:255 B:0 A:255.
        /// </summary>
        public static Color Chartreuse {
            get {
                return new Color(4278255487);
            }
        }

        /// <summary>
        /// Gets a color with the index R:210 G:105 B:30 A:255.
        /// </summary>
        public static Color Chocolate {
            get {
                return new Color(4280183250);
            }
        }

        /// <summary>
        /// Gets a color with the index R:255 G:127 B:80 A:255.
        /// </summary>
        public static Color Coral {
            get {
                return new Color(4283465727);
            }
        }
 
        /// <summary>
        /// Gets a color with the index R:100 G:149 B:237 A:255.
        /// </summary>
        public static Color CornflowerBlue {
            get {
                return new Color(4293760356);
            }
        }
 
        /// <summary>
        /// Gets a color with the index R:255 G:248 B:220 A:255.
        /// </summary>
        public static Color Cornsilk {
            get {
                return new Color(4292671743);
            }
        }
 
        /// <summary>
        /// Gets a color with the index R:220 G:20 B:60 A:255.
        /// </summary>
        public static Color Crimson {
            get {
                return new Color(4282127580);
            }
        }
 
        /// <summary>
        /// Gets a color with the index R:0 G:255 B:255 A:255.
        /// </summary>
        public static Color Cyan {
            get {
                return new Color(4294967040);
            }
        }
 
        /// <summary>
        /// Gets a color with the index R:0 G:0 B:139 A:255.
        /// </summary>
        public static Color DarkBlue {
            get {
                return new Color(4287299584);
            }
        }
 
        /// <summary>
        /// Gets a color with the index R:0 G:139 B:139 A:255.
        /// </summary>
        public static Color DarkCyan {
            get {
                return new Color(4287335168);
            }
        }
 
        /// <summary>
        /// Gets a color with the index R:184 G:134 B:11 A:255.
        /// </summary>
        public static Color DarkGoldenrod {
            get {
                return new Color(4278945464);
            }
        }
 
        /// <summary>
        /// Gets a color with the index R:169 G:169 B:169 A:255.
        /// </summary>
        public static Color DarkGray {
            get {
                return new Color(4289309097);
            }
        }

        /// <summary>
        /// Gets a color with the index R:0 G:100 B:0 A:255.
        /// </summary>
        public static Color DarkGreen {
            get {
                return new Color(4278215680);
            }
        }

        /// <summary>
        /// Gets a color with the index R:189 G:183 B:107 A:255.
        /// </summary>
        public static Color DarkKhaki {
            get {
                return new Color(4285249469);
            }
        }

        /// <summary>
        /// Gets a color with the index R:139 G:0 B:139 A:255.
        /// </summary>
        public static Color DarkMagenta {
            get {
                return new Color(4287299723);
            }
        }
 
        /// <summary>
        /// Gets a color with the index R:85 G:107 B:47 A:255.
        /// </summary>
        public static Color DarkOliveGreen {
            get {
                return new Color(4281297749);
            }
        }
 
        /// <summary>
        /// Gets a color with the index R:255 G:140 B:0 A:255.
        /// </summary>
        public static Color DarkOrange {
            get {
                return new Color(4278226175);
            }
        }

        /// <summary>
        /// Gets a color with the index R:153 G:50 B:204 A:255.
        /// </summary>
        public static Color DarkOrchid {
            get {
                return new Color(4291572377);
            }
        }

        /// <summary>
        /// Gets a color with the index R:139 G:0 B:0 A:255.
        /// </summary>
        public static Color DarkRed {
            get {
                return new Color(4278190219);
            }
        }
 
        /// <summary>
        /// Gets a color with the index R:233 G:150 B:122 A:255.
        /// </summary>
        public static Color DarkSalmon {
            get {
                return new Color(4286224105);
            }
        }
 
        /// <summary>
        /// Gets a color with the index R:143 G:188 B:139 A:255.
        /// </summary>
        public static Color DarkSeaGreen {
            get {
                return new Color(4287347855);
            }
        }

        /// <summary>
        /// Gets a color with the index R:72 G:61 B:139 A:255.
        /// </summary>
        public static Color DarkSlateBlue {
            get {
                return new Color(4287315272);
            }
        }

        /// <summary>
        /// Gets a color with the index R:47 G:79 B:79 A:255.
        /// </summary>
        public static Color DarkSlateGray {
            get {
                return new Color(4283387695);
            }
        }

        /// <summary>
        /// Gets a color with the index R:0 G:206 B:209 A:255.
        /// </summary>
        public static Color DarkTurquoise {
            get {
                return new Color(4291939840);
            }
        }

        /// <summary>
        /// Gets a color with the index R:148 G:0 B:211 A:255.
        /// </summary>
        public static Color DarkViolet {
            get {
                return new Color(4292018324);
            }
        }

        /// <summary>
        /// Gets a color with the index R:255 G:20 B:147 A:255.
        /// </summary>
        public static Color DeepPink {
            get {
                return new Color(4287829247);
            }
        }
        
        /// <summary>
        /// Gets a color with the index R:0 G:191 B:255 A:255.
        /// </summary>
        public static Color DeepSkyBlue {
            get {
                return new Color(4294950656);
            }
        }

        /// <summary>
        /// Gets a color with the index R:105 G:105 B:105 A:255.
        /// </summary>
        public static Color DimGray {
            get {
                return new Color(4285098345);
            }
        }

        /// <summary>
        /// Gets a color with the index R:30 G:144 B:255 A:255.
        /// </summary>
        public static Color DodgerBlue {
            get {
                return new Color(4294938654);
            }
        }

        /// <summary>
        /// Gets a color with the index R:178 G:34 B:34 A:255.
        /// </summary>
        public static Color Firebrick {
            get {
                return new Color(4280427186);
            }
        }

        /// <summary>
        /// Gets a color with the index R:255 G:250 B:240 A:255.
        /// </summary>
        public static Color FloralWhite {
            get {
                return new Color(4293982975);
            }
        }

        /// <summary>
        /// Gets a color with the index R:34 G:139 B:34 A:255.
        /// </summary>
        public static Color ForestGreen {
            get {
                return new Color(4280453922);
            }
        }

        /// <summary>
        /// Gets a color with the index R:255 G:0 B:255 A:255.
        /// </summary>
        public static Color Fuchsia {
            get {
                return new Color(4294902015);
            }
        }

        /// <summary>
        /// Gets a color with the index R:220 G:220 B:220 A:255.
        /// </summary>
        public static Color Gainsboro {
            get {
                return new Color(4292664540);
            }
        }

        /// <summary>
        /// Gets a color with the index R:248 G:248 B:255 A:255.
        /// </summary>
        public static Color GhostWhite {
            get {
                return new Color(4294965496);
            }
        }

        /// <summary>
        /// Gets a color with the index R:255 G:215 B:0 A:255.
        /// </summary>
        public static Color Gold {
            get {
                return new Color(4278245375);
            }
        }

        /// <summary>
        /// Gets a color with the index R:218 G:165 B:32 A:255.
        /// </summary>
        public static Color Goldenrod {
            get {
                return new Color(4280329690);
            }
        }

        /// <summary>
        /// Gets a color with the index R:128 G:128 B:128 A:255.
        /// </summary>
        public static Color Gray {
            get {
                return new Color(4286611584);
            }
        }

        /// <summary>
        /// Gets a color with the index R:0 G:128 B:0 A:255.
        /// </summary>
        public static Color Green {
            get {
                return new Color(4278222848);
            }
        }

        /// <summary>
        /// Gets a color with the index R:173 G:255 B:47 A:255.
        /// </summary>
        public static Color GreenYellow {
            get {
                return new Color(4281335725);
            }
        }

        /// <summary>
        /// Gets a color with the index R:240 G:255 B:240 A:255.
        /// </summary>
        public static Color Honeydew {
            get {
                return new Color(4293984240);
            }
        }

        /// <summary>
        /// Gets a color with the index R:255 G:105 B:180 A:255.
        /// </summary>
        public static Color HotPink {
            get {
                return new Color(4290013695);
            }
        }

        /// <summary>
        /// Gets a color with the index R:205 G:92 B:92 A:255.
        /// </summary>
        public static Color IndianRed {
            get {
                return new Color(4284243149);
            }
        }

        /// <summary>
        /// Gets a color with the index R:75 G:0 B:130 A:255.
        /// </summary>
        public static Color Indigo {
            get {
                return new Color(4286709835);
            }
        }

        /// <summary>
        /// Gets a color with the index R:255 G:255 B:240 A:255.
        /// </summary>
        public static Color Ivory {
            get {
                return new Color(4293984255);
            }
        }

        /// <summary>
        /// Gets a color with the index R:240 G:230 B:140 A:255.
        /// </summary>
        public static Color Khaki {
            get {
                return new Color(4287424240);
            }
        }

        /// <summary>
        /// Gets a color with the index R:230 G:230 B:250 A:255.
        /// </summary>
        public static Color Lavender {
            get {
                return new Color(4294633190);
            }
        }

        /// <summary>
        /// Gets a color with the index R:255 G:240 B:245 A:255.
        /// </summary>
        public static Color LavenderBlush {
            get {
                return new Color(4294308095);
            }
        }

        /// <summary>
        /// Gets a color with the index R:124 G:252 B:0 A:255.
        /// </summary>
        public static Color LawnGreen {
            get {
                return new Color(4278254716);
            }
        }

        /// <summary>
        /// Gets a color with the index R:255 G:250 B:205 A:255.
        /// </summary>
        public static Color LemonChiffon {
            get {
                return new Color(4291689215);
            }
        }

        /// <summary>
        /// Gets a color with the index R:173 G:216 B:230 A:255.
        /// </summary>
        public static Color LightBlue {
            get {
                return new Color(4293318829);
            }
        }

        /// <summary>
        /// Gets a color with the index R:240 G:128 B:128 A:255.
        /// </summary>
        public static Color LightCoral {
            get {
                return new Color(4286611696);
            }
        }

        /// <summary>
        /// Gets a color with the index R:224 G:255 B:255 A:255.
        /// </summary>
        public static Color LightCyan {
            get {
                return new Color(4294967264);
            }
        }

        /// <summary>
        /// Gets a color with the index R:250 G:250 B:210 A:255.
        /// </summary>
        public static Color LightGoldenrodYellow {
            get {
                return new Color(4292016890);
            }
        }

        /// <summary>
        /// Gets a color with the index R:144 G:238 B:144 A:255.
        /// </summary>
        public static Color LightGreen {
            get {
                return new Color(4287688336);
            }
        }

        /// <summary>
        /// Gets a color with the index R:211 G:211 B:211 A:255.
        /// </summary>
        public static Color LightGray {
            get {
                return new Color(4292072403);
            }
        }

        /// <summary>
        /// Gets a color with the index R:255 G:182 B:193 A:255.
        /// </summary>
        public static Color LightPink {
            get {
                return new Color(4290885375);
            }
        }

        /// <summary>
        /// Gets a color with the index R:255 G:160 B:122 A:255.
        /// </summary>
        public static Color LightSalmon {
            get {
                return new Color(4286226687);
            }
        }

        /// <summary>
        /// Gets a color with the index R:32 G:178 B:170 A:255.
        /// </summary>
        public static Color LightSeaGreen {
            get {
                return new Color(4289376800);
            }
        }

        /// <summary>
        /// Gets a color with the index R:135 G:206 B:250 A:255.
        /// </summary>
        public static Color LightSkyBlue {
            get {
                return new Color(4294626951);
            }
        }

        /// <summary>
        /// Gets a color with the index R:119 G:136 B:153 A:255.
        /// </summary>
        public static Color LightSlateGray {
            get {
                return new Color(4288252023);
            }
        }

        /// <summary>
        /// Gets a color with the index R:176 G:196 B:222 A:255.
        /// </summary>
        public static Color LightSteelBlue {
            get {
                return new Color(4292789424);
            }
        }

        /// <summary>
        /// Gets a color with the index R:255 G:255 B:224 A:255.
        /// </summary>
        public static Color LightYellow {
            get {
                return new Color(4292935679);
            }
        }

        /// <summary>
        /// Gets a color with the index R:0 G:255 B:0 A:255.
        /// </summary>
        public static Color Lime {
            get {
                return new Color(4278255360);
            }
        }

        /// <summary>
        /// Gets a color with the index R:50 G:205 B:50 A:255.
        /// </summary>
        public static Color LimeGreen {
            get {
                return new Color(4281519410);
            }
        }

        /// <summary>
        /// Gets a color with the index R:250 G:240 B:230 A:255.
        /// </summary>
        public static Color Linen {
            get {
                return new Color(4293325050);
            }
        }

        /// <summary>
        /// Gets a color with the index R:255 G:0 B:255 A:255.
        /// </summary>
        public static Color Magenta {
            get {
                return new Color(4294902015);
            }
        }

        /// <summary>
        /// Gets a color with the index R:128 G:0 B:0 A:255.
        /// </summary>
        public static Color Maroon {
            get {
                return new Color(4278190208);
            }
        }

        /// <summary>
        /// Gets a color with the index R:102 G:205 B:170 A:255.
        /// </summary>
        public static Color MediumAquamarine {
            get {
                return new Color(4289383782);
            }
        }

        /// <summary>
        /// Gets a color with the index R:0 G:0 B:205 A:255.
        /// </summary>
        public static Color MediumBlue {
            get {
                return new Color(4291624960);
            }
        }

        /// <summary>
        /// Gets a color with the index R:186 G:85 B:211 A:255.
        /// </summary>
        public static Color MediumOrchid {
            get {
                return new Color(4292040122);
            }
        }

        /// <summary>
        /// Gets a color with the index R:147 G:112 B:219 A:255.
        /// </summary>
        public static Color MediumPurple {
            get {
                return new Color(4292571283);
            }
        }

        /// <summary>
        /// Gets a color with the index R:60 G:179 B:113 A:255.
        /// </summary>
        public static Color MediumSeaGreen {
            get {
                return new Color(4285641532);
            }
        }

        /// <summary>
        /// Gets a color with the index R:123 G:104 B:238 A:255.
        /// </summary>
        public static Color MediumSlateBlue {
            get {
                return new Color(4293814395);
            }
        }

        /// <summary>
        /// Gets a color with the index R:0 G:250 B:154 A:255.
        /// </summary>
        public static Color MediumSpringGreen {
            get {
                return new Color(4288346624);
            }
        }

        /// <summary>
        /// Gets a color with the index R:72 G:209 B:204 A:255.
        /// </summary>
        public static Color MediumTurquoise {
            get {
                return new Color(4291613000);
            }
        }

        /// <summary>
        /// Gets a color with the index R:199 G:21 B:133 A:255.
        /// </summary>
        public static Color MediumVioletRed {
            get {
                return new Color(4286911943);
            }
        }

        /// <summary>
        /// Gets a color with the index R:25 G:25 B:112 A:255.
        /// </summary>
        public static Color MidnightBlue {
            get {
                return new Color(4285536537);
            }
        }

        /// <summary>
        /// Gets a color with the index R:245 G:255 B:250 A:255.
        /// </summary>
        public static Color MintCream {
            get {
                return new Color(4294639605);
            }
        }

        /// <summary>
        /// Gets a color with the index R:255 G:228 B:225 A:255.
        /// </summary>
        public static Color MistyRose {
            get {
                return new Color(4292994303);
            }
        }

        /// <summary>
        /// Gets a color with the index R:255 G:228 B:181 A:255.
        /// </summary>
        public static Color Moccasin {
            get {
                return new Color(4290110719);
            }
        }

        /// <summary>
        /// Gets a color with the index R:255 G:222 B:173 A:255.
        /// </summary>
        public static Color NavajoWhite {
            get {
                return new Color(4289584895);
            }
        }

        /// <summary>
        /// Gets a color with the index R:0 G:0 B:128 A:255.
        /// </summary>
        public static Color Navy {
            get {
                return new Color(4286578688);
            }
        }

        /// <summary>
        /// Gets a color with the index R:253 G:245 B:230 A:255.
        /// </summary>
        public static Color OldLace {
            get {
                return new Color(4293326333);
            }
        }

        /// <summary>
        /// Gets a color with the index R:128 G:128 B:0 A:255.
        /// </summary>
        public static Color Olive {
            get {
                return new Color(4278222976);
            }
        }

        /// <summary>
        /// Gets a color with the index R:107 G:142 B:35 A:255.
        /// </summary>
        public static Color OliveDrab {
            get {
                return new Color(4280520299);
            }
        }

        /// <summary>
        /// Gets a color with the index R:255 G:165 B:0 A:255.
        /// </summary>
        public static Color Orange {
            get {
                return new Color(4278232575);
            }
        }

        /// <summary>
        /// Gets a color with the index R:255 G:69 B:0 A:255.
        /// </summary>
        public static Color OrangeRed {
            get {
                return new Color(4278207999);
            }
        }

        /// <summary>
        /// Gets a color with the index R:218 G:112 B:214 A:255.
        /// </summary>
        public static Color Orchid {
            get {
                return new Color(4292243674);
            }
        }

        /// <summary>
        /// Gets a color with the index R:238 G:232 B:170 A:255.
        /// </summary>
        public static Color PaleGoldenrod {
            get {
                return new Color(4289390830);
            }
        }

        /// <summary>
        /// Gets a color with the index R:152 G:251 B:152 A:255.
        /// </summary>
        public static Color PaleGreen {
            get {
                return new Color(4288215960);
            }
        }

        /// <summary>
        /// Gets a color with the index R:175 G:238 B:238 A:255.
        /// </summary>
        public static Color PaleTurquoise {
            get {
                return new Color(4293848751);
            }
        }

        /// <summary>
        /// Gets a color with the index R:219 G:112 B:147 A:255.
        /// </summary>
        public static Color PaleVioletRed {
            get {
                return new Color(4287852763);
            }
        }

        /// <summary>
        /// Gets a color with the index R:255 G:239 B:213 A:255.
        /// </summary>
        public static Color PapayaWhip {
            get {
                return new Color(4292210687);
            }
        }

        /// <summary>
        /// Gets a color with the index R:255 G:218 B:185 A:255.
        /// </summary>
        public static Color PeachPuff {
            get {
                return new Color(4290370303);
            }
        }

        /// <summary>
        /// Gets a color with the index R:205 G:133 B:63 A:255.
        /// </summary>
        public static Color Peru {
            get {
                return new Color(4282353101);
            }
        }

        /// <summary>
        /// Gets a color with the index R:255 G:192 B:203 A:255.
        /// </summary>
        public static Color Pink {
            get {
                return new Color(4291543295);
            }
        }

        /// <summary>
        /// Gets a color with the index R:221 G:160 B:221 A:255.
        /// </summary>
        public static Color Plum {
            get {
                return new Color(4292714717);
            }
        }

        /// <summary>
        /// Gets a color with the index R:176 G:224 B:230 A:255.
        /// </summary>
        public static Color PowderBlue {
            get {
                return new Color(4293320880);
            }
        }

        /// <summary>
        /// Gets a color with the index R:128 G:0 B:128 A:255.
        /// </summary>
        public static Color Purple {
            get {
                return new Color(4286578816);
            }
        }

        /// <summary>
        /// Gets a color with the index R:255 G:0 B:0 A:255.
        /// </summary>
        public static Color Red {
            get {
                return new Color(4278190335);
            }
        }

        /// <summary>
        /// Gets a color with the index R:188 G:143 B:143 A:255.
        /// </summary>
        public static Color RosyBrown {
            get {
                return new Color(4287598524);
            }
        }

        /// <summary>
        /// Gets a color with the index R:65 G:105 B:225 A:255.
        /// </summary>
        public static Color RoyalBlue {
            get {
                return new Color(4292962625);
            }
        }

        /// <summary>
        /// Gets a color with the index R:139 G:69 B:19 A:255.
        /// </summary>
        public static Color SaddleBrown {
            get {
                return new Color(4279453067);
            }
        }

        /// <summary>
        /// Gets a color with the index R:250 G:128 B:114 A:255.
        /// </summary>
        public static Color Salmon {
            get {
                return new Color(4285694202);
            }
        }

        /// <summary>
        /// Gets a color with the index R:244 G:164 B:96 A:255.
        /// </summary>
        public static Color SandyBrown {
            get {
                return new Color(4284523764);
            }
        }

        /// <summary>
        /// Gets a color with the index R:46 G:139 B:87 A:255.
        /// </summary>
        public static Color SeaGreen {
            get {
                return new Color(4283927342);
            }
        }

        /// <summary>
        /// Gets a color with the index R:255 G:245 B:238 A:255.
        /// </summary>
        public static Color SeaShell {
            get {
                return new Color(4293850623);
            }
        }

        /// <summary>
        /// Gets a color with the index R:160 G:82 B:45 A:255.
        /// </summary>
        public static Color Sienna {
            get {
                return new Color(4281160352);
            }
        }

        /// <summary>
        /// Gets a color with the index R:192 G:192 B:192 A:255.
        /// </summary>
        public static Color Silver {
            get {
                return new Color(4290822336);
            }
        }

        /// <summary>
        /// Gets a color with the index R:135 G:206 B:235 A:255.
        /// </summary>
        public static Color SkyBlue {
            get {
                return new Color(4293643911);
            }
        }

        /// <summary>
        /// Gets a color with the index R:106 G:90 B:205 A:255.
        /// </summary>
        public static Color SlateBlue {
            get {
                return new Color(4291648106);
            }
        }

        /// <summary>
        /// Gets a color with the index R:112 G:128 B:144 A:255.
        /// </summary>
        public static Color SlateGray {
            get {
                return new Color(4287660144);
            }
        }

        /// <summary>
        /// Gets a color with the index R:255 G:250 B:250 A:255.
        /// </summary>
        public static Color Snow {
            get {
                return new Color(4294638335);
            }
        }

        /// <summary>
        /// Gets a color with the index R:0 G:255 B:127 A:255.
        /// </summary>
        public static Color SpringGreen {
            get {
                return new Color(4286578432);
            }
        }

        /// <summary>
        /// Gets a color with the index R:70 G:130 B:180 A:255.
        /// </summary>
        public static Color SteelBlue {
            get {
                return new Color(4290019910);
            }
        }

        /// <summary>
        /// Gets a color with the index R:210 G:180 B:140 A:255.
        /// </summary>
        public static Color Tan {
            get {
                return new Color(4287411410);
            }
        }

        /// <summary>
        /// Gets a color with the index R:0 G:128 B:128 A:255.
        /// </summary>
        public static Color Teal {
            get {
                return new Color(4286611456);
            }
        }

        /// <summary>
        /// Gets a color with the index R:216 G:191 B:216 A:255.
        /// </summary>
        public static Color Thistle {
            get {
                return new Color(4292394968);
            }
        }

        /// <summary>
        /// Gets a color with the index R:255 G:99 B:71 A:255.
        /// </summary>
        public static Color Tomato {
            get {
                return new Color(4282868735);
            }
        }

        /// <summary>
        /// Gets a color with the index R:64 G:224 B:208 A:255.
        /// </summary>
        public static Color Turquoise {
            get {
                return new Color(4291878976);
            }
        }

        /// <summary>
        /// Gets a color with the index R:238 G:130 B:238 A:255.
        /// </summary>
        public static Color Violet {
            get {
                return new Color(4293821166);
            }
        }

        /// <summary>
        /// Gets a color with the index R:245 G:222 B:179 A:255.
        /// </summary>
        public static Color Wheat {
            get {
                return new Color(4289978101);
            }
        }

        /// <summary>
        /// Gets a color with the index R:255 G:255 B:255 A:255.
        /// </summary>
        public static Color White {
            get {
                return new Color(uint.MaxValue);
            }
        }

        /// <summary>
        /// Gets a color with the index R:245 G:245 B:245 A:255.
        /// </summary>
        public static Color WhiteSmoke {
            get {
                return new Color(4294309365);
            }
        }

        /// <summary>
        /// Gets a color with the index R:255 G:255 B:0 A:255.
        /// </summary>
        public static Color Yellow {
            get {
                return new Color(4278255615);
            }
        }

        /// <summary>
        /// Gets a color with the index R:154 G:205 B:50 A:255.
        /// </summary>
        public static Color YellowGreen {
            get {
                return new Color(4281519514);
            }
        }
    }
}